<?php


if (!defined('EXPONENT')) exit('');

$link = null;
if (isset($_GET['id'])) {
	$link = $db->selectObject('rsrequest_item','id='.intval($_GET['id']));
}

if ($link) {
	if (exponent_permissions_check('delete',$loc) || exponent_permissions_check('administrator',$loc)) {
        if ($link->request_type == 0)
        {
            // delete all respone
            $db->delete('rsrequest_item','parent_id='.$link->id);
        }
		$db->delete('rsrequest_item','id='.$link->id);
		exponent_flow_redirect();
	} else {
		echo SITE_403_HTML;
	}
} else {
	echo SITE_404_HTML;
}

?>
